<template>
  <el-dialog
    :visible="show"
    :before-close="close"
    custom-class="custom-dialog"
    :title="source.clientName + '的纠违记录详情'"
  >
    <el-table :data="tableData" :show-header="false">
      <el-table-column
        property="label"
        label="项目"
        width="150"
      ></el-table-column>
      <el-table-column property="value" label="内容"></el-table-column>
    </el-table>
    <div slot="footer">
      <el-tooltip
        class="item"
        effect="dark"
        content="该功能暂时禁用"
        placement="bottom"
      >
        <el-button type="danger" v-if="+source.status === 0">撤消</el-button>
      </el-tooltip>
      <el-tooltip
        class="item"
        effect="dark"
        content="该功能暂时禁用"
        placement="bottom"
      >
        <el-button type="success" v-if="+source.status === -1">恢复</el-button>
      </el-tooltip>
      <el-button @click="close">关闭</el-button>
    </div>
  </el-dialog>
</template>
<script>
export default {
  props: ["source", "show"],
  computed: {
    tableData() {
      let source = this.source;
      return [
        {
          label: "当事人员",
          value:
            source.clientOffice +
            " / " +
            source.clientGroup +
            " / " +
            source.clientName,
        },
        { label: "资质", value: source.clientRank },
        { label: "事发时间", value: source.eventTime },
        {
          label: "事发席位",
          value: (source.sector != "" ? source.sector + " " : "") + source.seat,
        },
        {
          label: "搭档人员",
          value: source.partners.replace(/,/g, "，").replace(/-/g, " "),
        },
        { label: "纠违项目", value: source.category + " / " + source.item },
        { label: "附加描述", value: source.attributes.replace(/,/g, "，") },
        { label: "文字描述", value: source.description },
        {
          label: "带班主任",
          value:
            source.userOffice +
            " / " +
            source.userGroup +
            " / " +
            source.userName,
        },
        // { label: "", value: source.name }
      ];
    },
  },
  methods: {
    close() {
      this.$emit("close");
    },
  },
};
/*
attributes: "影响其它扇区"
category: "带班主任责任"
clientGroup: ""
clientName: "刘锐"
clientOffice: "管制一室"
description: "haha"
eventTime: "2020-07-02 12:47:04"
item: "排班或批准换班不合规，导致班组力量搭配不合理"
number: "2"
partners: "管制一室-陈虹宇,管制二室-姚昕"
seat: "协调席"
sector: "03#"
status: "0"
submitTime: "2020-07-02 12:48:13"
userGroup: ""
userName: "王涛"
userOffice: ""
*/
</script>

<style></style>
